package com.li.controller;

import com.li.utile.DownLoadUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
@Slf4j
public class DownLoadController {
    @Autowired
    private DownLoadUtil downLoadUtil;

    @GetMapping("{fileName}")
    public void downLoad(@PathVariable String fileName, HttpServletResponse response) throws Exception {
        downLoadUtil.downLoad(response,fileName);
    }
}
